#include <algorithm>
#include <iostream>
using namespace std;

const int kMaxN = 2e5 + 10;

int a[kMaxN];

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int T;
  for (cin >> T; T; T--) {
    int n;

    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    sort(a, a + n);

    int ans = 0;
    for (int i = 0; i < n; i += 2) {
      ans = max(a[i + 1] - a[i], ans);
    }
    cout << ans << "\n";
  }
  return 0;
}